//
//  NSObject+NSThreadPerformAdditionsCustom.m
//  PPT
//
//  Created by admin on 15/12/15.
//  Copyright (c) 2015年 haoniu. All rights reserved.
//  作用：button传递多个参数

#import "NSObject+NSThreadPerformAdditionsCustom.h"

@implementation NSObject (NSThreadPerformAdditionsCustom)

- (void) performSelectorOnMainThread:(SEL)selector withObject:(id)arg1 withObject:(id)arg2 waitUntilDone:(BOOL)wait
{
    NSMethodSignature *sig = [self methodSignatureForSelector:selector];
    if (!sig) return;
    NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig];
    [invo setTarget:self];
    [invo setSelector:selector];
    [invo setArgument:&arg1 atIndex:2];
    [invo setArgument:&arg2 atIndex:3];
    [invo retainArguments];
    [invo performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:wait];
}

@end
